package utils;

import android.graphics.Bitmap;
import android.util.LruCache;

import com.android.volley.toolbox.ImageLoader;

/**
 * 图片缓存类
 */
public class MyImageCache implements ImageLoader.ImageCache {
    private LruCache cache = new LruCache(10 * 1024 * 1024);
    public MyImageCache() {
    }

    @Override
    public Bitmap getBitmap(String url) {

        return (Bitmap) cache.get(url);
    }
    @Override
    public void putBitmap(String url, Bitmap bitmap) {
        cache.put(url, bitmap);
    }
}
